﻿using System;
using System.Collections.Generic;
using System.Text;
using Autofac;
using Microsoft.AspNetCore.Http;
using KG.SystemService;
using System.Reflection;

namespace KG.ServiceLogic.Logic
{
    public class LogicAutofac
    {
        /// <summary>
        /// 相关服务注入
        /// </summary>
        /// <param name="builder"></param>
        public static void InitAutofac(ContainerBuilder builder)
        {
            //注入Http授权验证
            builder.RegisterType(typeof(HttpContextAccessor)).As(typeof(IHttpContextAccessor));
            //注册基础服务
            #region
            builder.RegisterType(typeof(NodeService));
            builder.RegisterType(typeof(RelationService));
            // 注入service
            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly());
            #endregion
        }
    }
}
